package easy

import "strings"

func RotateString(s string, goal string) bool {
	return len(s) == len(goal) && strings.Contains(s+s, goal)
}

func RotateString1(s string, goal string) bool {
	n := len(s)
	if n != len(goal) {
		return false
	}
next:
	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if s[(i+j)%n] != goal[j] {
				continue next
			}
		}
		return true
	}
	return false
}
